<div class="nhdActivityRecords form">
	
	
	<div style="margin-bottom:20px;">
    
    <form action="<?php echo $this->Html->url(array('action' => 'add')); ?>" method="POST" id="filter_add">
    
    <h4><?php __('Tỉnh/Thành'); ?>:
        <select onchange="document.getElementById('NhdActivityRecordCityId').value = this.value;document.getElementById('filter_add').submit()" name="filter_city_id">
            <?php foreach($cities as $c ) {
                $selected = "";
                if($c["id"] == $city["id"])
                {
                    $selected = 'selected="selected"';
                }
            ?>
                <option value="<?php echo $c["id"] ?>" <?php echo $selected; ?> ><?php echo $c["name"] ?></option>
            <?php } ?>
        </select>
    </h4>
    <h4><?php __('Năm'); ?>:
        <select onchange="document.getElementById('NhdActivityRecordYear').value = this.value;document.getElementById('filter_add').submit()" name="filter_year">        
            <?php for($i=1991; $i < 2031; $i++ ) {
                $selected = "";
                if($year == $i)
                {
                    $selected = 'selected="selected"';
                }
            ?>
                <option value="<?php echo $i ?>" <?php echo $selected; ?> ><?php echo $i ?></option>
            <?php } ?>
        </select>
    </h4>
    <h4><?php __('Quý'); ?>:
        <select onchange="document.getElementById('NhdActivityRecordQuarter').value = this.value;document.getElementById('filter_add').submit()" name="filter_quarter">        
            <?php for($i=1; $i < 5; $i++ ) {
                $selected = "";
                if($quarter == $i)
                {
                    $selected = 'selected="selected"';
                }
            ?>
                <option value="<?php echo $i ?>" <?php echo $selected; ?> ><?php echo $i ?></option>
            <?php } ?>
        </select>
    </h4>
    </form>
    
</div>
	
	
<?php echo $this->Form->create('NhdActivityRecord');?>
	<fieldset>
		<legend><?php __('Thống kê hoạt động RHM'); ?></legend>
	<?php
		//echo $this->Form->input('user_id');
		echo $this->Form->input('city_id', array('type'=>'hidden', 'value'=>$city["id"]));
		//echo $this->Form->input('nhd_activity_id');s
		//echo $this->Form->input('school_num');
		//echo $this->Form->input('school_rate');
		//echo $this->Form->input('student_num');
		//echo $this->Form->input('student_rate');
		//echo $this->Form->input('unit_id');
		echo $this->Form->input('year', array('label'=>'Năm', 'type'=>'hidden', 'value'=>$year));
		echo $this->Form->input('quarter', array('label'=>'Quý', 'type'=>'hidden', 'value'=>$quarter));
	?>
	
	<div class="input text required">
		<label for="NhdDeviceResourceValue">Bảng cập nhật</label>		
		<table cellpadding="0" cellpadding="0" id="input_tablez">
			<tr>
				<th colspan="3" rowspan="2"><?php __('Nội dung hoạt động'); ?></th>
				<th colspan="2"><?php __('Trường'); ?></th>
				<th colspan="2"><?php __('Học sinh'); ?></th>
			</tr>
			<tr>				
				<th><?php __('Số lượng'); ?></th>
				<th><?php __('Tỉ lệ(%) đáp ứng'); ?></th>
				<th><?php __('Số lượng'); ?></th>
				<th><?php __('Tỉ lệ(%) đáp ứng'); ?></th>
			</tr>
			<?php foreach($nhdActivities as $b => $item) { ?>
				<tr>
					<td><?php $i = $b == 0 ? 0 : $b-1; echo $b == 0 ? "ND".$item["NhdActivityCategory"]["nd"] : ''; echo $item["NhdActivityCategory"]["nd"] != $nhdActivities[$i]["NhdActivityCategory"]["nd"] ? "ND".$item["NhdActivityCategory"]["nd"] : ''; ?></td>
					<td><?php $i = $b == 0 ? 0 : $b-1; echo $b == 0 ? $item["NhdActivityCategory"]["name"] : ''; echo $item["NhdActivityCategory"]["name"] != $nhdActivities[$i]["NhdActivityCategory"]["name"] ? $item["NhdActivityCategory"]["name"] : ''; ?></td>
					<td><?php echo $item["NhdActivity"]["name"] ?></td>					
					<td>
						
							<input class="iit" type="text" id="NhdActivityRecordSchoolNum_<?php echo $item["NhdActivity"]["id"] ?>" value="<?php echo $item["NhdActivityRecord"]["school_num"] ?>" maxlength="255" name="data[NhdActivityRecord][records][<?php echo $item["NhdActivity"]["id"] ?>][school_num]" />
					</td>
					<td>
							<input class="" type="text" id="NhdActivityRecordSchoolRate_<?php echo $item["NhdActivity"]["id"] ?>" value="<?php echo $item["NhdActivityRecord"]["school_rate"] ?>" maxlength="255" name="data[NhdActivityRecord][records][<?php echo $item["NhdActivity"]["id"] ?>][school_rate]" />
					</td>
					<td>
							<input class="iit" type="text" id="NhdActivityRecordStudentNum_<?php echo $item["NhdActivity"]["id"] ?>" value="<?php echo $item["NhdActivityRecord"]["student_num"] ?>" maxlength="255" name="data[NhdActivityRecord][records][<?php echo $item["NhdActivity"]["id"] ?>][student_num]" />
					</td>
					<td>
							<input class="" type="text" id="NhdActivityRecordStudentRate_<?php echo $item["NhdActivity"]["id"] ?>" value="<?php echo $item["NhdActivityRecord"]["student_rate"] ?>" maxlength="255" name="data[NhdActivityRecord][records][<?php echo $item["NhdActivity"]["id"] ?>][student_rate]" />
					</td>
					
				</tr>
			<?php } ?>
		</table>
	</div>
	
	</fieldset>
<?php echo $this->Form->end(__('Lưu thông tin', true));?>
</div>
<div class="actions">
	<h3><?php __('Chức năng'); ?></h3>
	<ul>		
	</ul>
</div>